const path = require('path')
const execa = require('execa')
const chalk = require('chalk')

const root = path.join(__dirname, '..')

const run = function(bin, args, opts = {}) {
  // stdio: 'inherit' 将运行中的输出打印出来
  return execa(bin, args, { stdio: 'inherit', ...opts })
}
const step = msg => console.log(chalk.cyan(msg))
module.exports = {
  root,
  pkg: require(path.join(root, 'package.json')),
  packages: path.join(root, 'packages'),
  run,
  step
}
